"""
@Time ： 2021/12/6 18:09
@Auth ： ChenZhangKun
"""
import threading
import time


def demo1():
    for i in range(5):
        time.sleep(1)
        print(i)


def demo2():
    for i in range(5):
        time.sleep(1)
        print(i)


if __name__ == '__main__':
    """
    打印正在运行的线程
    """
    t1 = threading.Thread(target=demo1)
    t2 = threading.Thread(target=demo2)
    t1.start()
    t2.start()
    while t1.is_alive() or t2.is_alive():
        print(threading.enumerate())
